package vn.sunnet.game.SinhTon.screen;

import vn.sunnet.game.SinhTon.Interface.IDialogAndroid;
import vn.sunnet.game.SinhTon.Interface.IRequestHandler;
import vn.sunnet.game.SinhTon.global.Assets;
import vn.sunnet.game.SinhTon.global.Setting;

import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;

public class MyGame extends Game {

	public LoadingScreen loadingScreen;
	public MenuScreen menuScreen;
	public StageScreen stageScreen;
	public SelectMap selectMap;
	
	public IDialogAndroid dialog;
	public IRequestHandler request;
	public MyGame(IDialogAndroid dialog, IRequestHandler request) {
		// TODO Auto-generated constructor stub
		this.dialog = dialog;
		this.request= request;
	}
	
	@Override
	public void create() {
		Setting.loadPreferences();
		if(!Assets.LOADING)
			Assets.loadingAsset();
		Gdx.input.setCatchBackKey(true);
		
		setScreen(new LoadingScreen(this));
	}

	@Override
	public void dispose() {
		// TODO Auto-generated method stub
		Assets.disposeObjects();
		getScreen().dispose();
		super.dispose();
	}

}
